
function v_p1() {
	Phaser.State.call(this);
	// TODO: generated method.
}
var proto = Object.create(Phaser.State.prototype);
v_p1.prototype = proto;
v_p1.prototype.constructor = v_p1;

var cp1;
v_p1.prototype.preload = function() {
	cp1 = new c_p1(this.game);
};
v_p1.prototype.init = function() {

};
v_p1.prototype.create = function() {
	var title1Tw = cp1.game.add.tween(cp1.fP1title1_01);
	var title2Tw_1 = cp1.game.add.tween(cp1.fP1title2);
	var title2Tw_2 = cp1.game.add.tween(cp1.fP1title2);
	var title3Tw = cp1.game.add.tween(cp1.fP1title1_02);
	
	title1Tw.from({alpha:0},800,Phaser.Easing.Linear.In,true,0,0,false);
	title2Tw_1.from({alpha:0},800,Phaser.Easing.Linear.In,true,600,0,false);
	title2Tw_2.from(
			{
				width:cp1.fP1title2.width*0.1,
				height:cp1.fP1title2.height*0.1
			},800,Phaser.Easing.Back.Out,true,600,0,false
	);
	title3Tw.from({alpha:0},1000,Phaser.Easing.Linear.In,true,1300,0,false);
	
	var p1bluebgTw = cp1.game.add.tween(cp1.fP1bluebg);
	var p1peopleTw = cp1.game.add.tween(cp1.fP1people);
	var p1hendTw_1 = cp1.game.add.tween(cp1.fHands);
	var p1hendTw_2 = cp1.game.add.tween(cp1.fHands);
	var p1paperTw_1 = cp1.game.add.tween(cp1.fP1paper);
	var p1paperTw_2 = cp1.game.add.tween(cp1.fP1paper);
	var p1clockTw_1 = cp1.game.add.tween(cp1.fP1colock);
	var p1clockTw_2 = cp1.game.add.tween(cp1.fP1colock);
	var p1linghtTw_1 = cp1.game.add.tween(cp1.fP1lightning);
	var p1linghtTw_2 = cp1.game.add.tween(cp1.fP1lightning);
	p1bluebgTw.from(
			{	
				alpha:0,
				width:cp1.fP1bluebg.width*2,
				height:cp1.fP1bluebg.height*2
			},800,Phaser.Easing.Bounce.Out,true,1500,0,false
	);
	p1bluebgTw.from(
			{
				alpha:0,
				width:cp1.fP1bluebg.width*2,
				height:cp1.fP1bluebg.height*2
			},800,Phaser.Easing.Bounce.Out,true,1500,0,false
	);
	p1peopleTw.from({alpha:0},800,Phaser.Easing.Linear.In,true,1800,0,false);
	p1hendTw_1.from({alpha:0},800,Phaser.Easing.Linear.In,true,1800,0,false);
	p1hendTw_2.from({angle:3},100,Phaser.Easing.Linear.In,true,2600,-1,true);
	p1linghtTw_1.from({alpha:0,x:280,y:596},300,Phaser.Easing.Linear.In,true,2900,0,false).onComplete.addOnce(function(){
		cp1.fP1paper.x = 96;
		cp1.fP1paper.y = 371;
		
		cp1.fP1colock.x = 303;
		cp1.fP1colock.y = 329;
		
		cp1.fP1lightning.x = 68;
		cp1.fP1lightning.y = 537;
		p1paperTw_2.to({x:107,y:381},400,Phaser.Easing.Linear.In,true,0,-1,true);
		p1clockTw_2.to({x:313,y:319},600,Phaser.Easing.Linear.In,true,0,-1,true);
		p1linghtTw_2.to({x:58,y:527},500,Phaser.Easing.Linear.In,true,0,-1,true);
		cp1.fPen.alpha = 1;
	});
	p1paperTw_1.from({alpha:0,x:280,y:520},300,Phaser.Easing.Linear.In,true,2500,0,false);
	p1clockTw_1.from({alpha:0,x:280,y:483},300,Phaser.Easing.Linear.In,true,2700,0,false);
	
	var p1txtTw = cp1.game.add.tween(cp1.fP1_txt);
	p1txtTw.from(
			{	
				alpha:0,
				width:cp1.fP1_txt.width*2,
				height:cp1.fP1_txt.height*2
			},800,Phaser.Easing.Linear.In,true,3300,0,false
	);
	var startBtnTw = cp1.game.add.tween(cp1.fStart_btn);
	startBtnTw.from(
			{	
				y:855,
				alpha:0,
				width:cp1.fStart_btn.width*2,
				height:cp1.fStart_btn.height*2
			},800,Phaser.Easing.Linear.In,true,3500,0,false
	).onComplete.addOnce(function(){
		cp1.fStart_btn.inputEnabled = true;
		cp1.fStart_btn.events.onInputDown.add(function(){
			cp1.game.view.show("v_p2");
		});
	});
	var penTw_1 = cp1.game.add.tween(cp1.fPen);
	var penTw_2 = cp1.game.add.tween(cp1.fPen);
	penTw_1.from({x:82},3000,Phaser.Easing.Linear.In,true,3500,0,false);
	penTw_2.from({angle:-14},1000,Phaser.Easing.Linear.In,true,3500,-1,true);
	
	
	
};
v_p1.prototype.update = function() {
	
};